#include <stdio.h>
int main ()
{
int sum = 0 , n , value;
   	do{
     printf("Enter an integer >= 1 \n");
     scanf("%d", &n);
     if(n < 1)
        printf("Error: Invalid input\n");
   } while ( n < 1);
while ( n > 0) {
	value = n % 10;
	sum += value;
	n = n / 10;
	;	}
printf (" sum of digits = %d" , sum);
return 0;
}
